package core

import (
    "authserver/global"
    "authserver/initialize"
    "fmt"
    "net/http"
    "time"
)

func RunWindowsServer() {

	Router := initialize.Routers()

	address := fmt.Sprintf(":%d", global.GVA_CONFIG.System.Addr)
	s := &http.Server{
		Addr:         address,
		Handler:      Router,
		ReadTimeout:  60 * time.Second,
		WriteTimeout: 60 * time.Second,
		//WriteTimeout:   15 * time.Minute,
		MaxHeaderBytes: 1 << 20,
	}

	// 保证文本顺序输出
	// In order to ensure that the text order output can be deletedfinancial_statistic
	time.Sleep(10 * time.Microsecond)
	global.GVA_LOG.Debug("server run success on ", address)

	//utils.StartServer()
	fmt.Printf(`欢迎使用 ims 默认已启动监听:http://127.0.0.1%s`, s.Addr)
	fmt.Println("")
	global.GVA_LOG.Error(s.ListenAndServe())
}
